<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	
	</head>
	<body>
		<button id="btn1">1</button>
		<button class="btn2">2</button>
		<button name="btn3">3</button>
		<button>4</button>
		<button>5</button>
		<script type="text/javascript">
			
			var btn1=document.getElementById("btn1");
			console.log(btn1);
			var btn2=document.getElementsByClassName("btn2")[0];//数组
			console.log(btn2);
			var btn3=document.getElementsByName("btn3")[0];//数组
			console.log(btn3);
			var btn4=document.querySelector(".btn2+button+button");//相邻兄弟
			console.log(btn4);
			var btn5=document.getElementsByTagName("button")[4];//数组
			console.log(btn5);
			
			
			
		</script>
	</body>
</html>
